#!/usr/bin/env bash
# Usage: plenv version-file-read <file>
# Reads the first non-whitespace word from the specified version file,
# careful not to load it whole in case there's something crazy in it.
if [ -e "$1" ]; then
  command -p awk 'BEGIN {rc=1} NF > 0 { print $1 ; exit rc=0 } END { exit rc }' "$1"
fi
